import fetch from '../utils/fetch'

/**
 * 业主个人主页
 */
export function userInfo() {
    return fetch({
        url: '/ygsj/customer/oauth/info',
        method: 'get',
    })
}

/**
 * 业主作品集收藏列表
 */
export function collectionWorks() {
    return fetch({
        url: '/ygsj/customer/oauth/collection/works',
        method: 'get',
    })
}

/**
 * 业主->设计师收藏列表
 */
export function collectionDesigner() {
    return fetch({
        url: '/ygsj/customer/oauth/collection/designer',
        method: 'get',
    })
}

/**
 * 业主->收藏作品
 */
export function collWorks(worksId) {
    return fetch({
        url: '/ygsj/customer/oauth/collWorks/' + worksId,
        method: 'post',
    })
}

/**
 * 业主->业主关注设计师
 */
export function collDesigner(designerId) {
    return fetch({
        url: '/ygsj/customer/oauth/coll/' + designerId,
        method: 'post',
    })
}

/**
 * 业主手机号登录
 * @param code 验证码
 * @param mobile 手机号
 */
export function mobileLogin(data) {
    return fetch({
        url: '/ygsj/customer/login/oauth',
        method: 'post',
        data: data
    })
}

/**
 * 校验业主手机号是否存在
 * @params mobile 手机号
 */
export function exsistMobile(mobile){
    return fetch({
        url: '/ygsj/customer/checkCusPhoneNumber/' + mobile,
        method: 'get'
    })
}

/**
 * setOpenId
 * @query openid  o-omR0S-6SCqB6mFVhoxRmNrJMeM
 */
export function setOpenId(openid = 'o-omR0S-6SCqB6mFVhoxRmNrJMeM') {
    return fetch({
        url: '/test/setOpenid?openid=' + openid,
        method: 'get'
    })
}